/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package interpretadorportugolvisual.partes;

import java.awt.Graphics;
import java.awt.Color;
import java.awt.Font;

/**
 *
 * @author abraaoisvioliveirasouzadocarmo
 */
public class BarramentoProcessador {


    private String palavra = "";
    private int y, x, py, mPY;
    private float b = 0.5f,  r = 0.5f,  g = 0.5f;

    public BarramentoProcessador(int x, int y, int mPY) {
        this.y = y;
        this.x = x;
        this.mPY = mPY;
        py = mPY;
    }

    public void desenhar(Graphics gd) {
        if(py < mPY) {

            Font font = Font.decode("Monospaced 18");
            gd.setFont(font);
//            gd.setColor(new Color(r, g, b));
//            gd.drawString(palavra, x, py+3);
            gd.setColor(Color.black);
            gd.drawString(palavra, x+5, py);
        }

        atualizar();
    }

    public void atualizar() {
        if(py < mPY) {
            py = py + 3;
        }
    }

    public boolean isBusy() {
        return py < mPY;
    }

    public void setPalavra(String p) {
        palavra = p;
        py = y;
    }
}
